package model

type RolePermissionsOutput struct {
	Checked []string              `json:"checked" dc:"菜单已选集合"`
	Rows    []*SelectMenuTreeItem `json:"rows" dc:"菜单集合"`
}

type MenuFormInput struct {
	DisplayName string `json:"display_name" v:"required|max-length:30" dc:"显示名称"`
	MenuName    string `json:"menu_name" v:"required|max-length:30" dc:"菜单编码"`
	MenuPath    string `json:"menu_path" v:"max-length:200" dc:"菜单路径"`
	Component   string `json:"component" v:"max-length:80" dc:"菜单组件"`
	MenuIcon    string `json:"menu_icon" v:"max-length:30" dc:"菜单图标"`
	MenuSort    uint   `json:"menu_sort" v:"integer|between:0,1000" dc:"菜单排序"`
	ParentId    uint64 `json:"parent_id" v:"integer|min:1" dc:"父级菜单id"`
	MenuGenre   uint   `json:"menu_genre" v:"integer|in:0,1,2,3" dc:"菜单类型：0-菜单、1-按钮、2-iframe、3-链接"`
	MenuHidden  uint   `json:"menu_hidden" v:"integer|in:0,1" dc:"是否隐藏"`
	MenuStatus  uint   `json:"menu_status" v:"integer|in:0,1" dc:"菜单状态：0-禁用、1-正常"`
}

type MenuItem struct {
	Id          uint64 `json:"id"`
	DisplayName string `json:"display_name"`
	MenuName    string `json:"menu_name"`
	MenuPath    string `json:"menu_path"`
	Component   string `json:"component"`
	MenuIcon    string `json:"menu_icon"`
	MenuSort    uint   `json:"menu_sort"`
	ParentId    uint64 `json:"parent_id"`
	MenuGenre   uint   `json:"menu_genre"`
	MenuHidden  uint   `json:"menu_hidden"`
	MenuStatus  uint   `json:"menu_status"`
}

type MenuTreeItem struct {
	*MenuItem
	MenuLevel uint            `json:"menu_level"`
	Children  []*MenuTreeItem `json:"children"`
}

type SelectMenuItem struct {
	Id          uint64 `json:"id"`
	DisplayName string `json:"display_name"`
	MenuName    string `json:"menu_name"`
	ParentId    uint64 `json:"parent_id"`
}

type SelectMenuTreeItem struct {
	*SelectMenuItem
	Children []*SelectMenuTreeItem `json:"children"`
}
